package com.come4loves.game.dataconfig.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.come4loves.core.dataconfig.ServiceAdapter;
import com.come4loves.game.dataconfig.model.BuffEffectConfig;
@Component
public class BuffEffectService extends ServiceAdapter{

	private static Map<Integer, BuffEffectConfig> map = new HashMap<Integer, BuffEffectConfig>();
	@Override
	public void clear() {
		map.clear();
	}

	@Override
	public void initialize() {
		List<BuffEffectConfig> list = this.dataConfig.listAll(this, BuffEffectConfig.class);
		for (BuffEffectConfig buffEffectConfig : list) {
			map.put(buffEffectConfig.getId(), buffEffectConfig);
		}
	}
	
	public static BuffEffectConfig get(int id) {
		return map.get(id);
	}

}
